<p>Trilium supports simple backup scheme where it saves copy of the&nbsp;
  <a
  class="reference-link" href="#root/_help_wX4HbRucYSDD">Database</a>&nbsp;on these events:</p>
<ul>
  <li>once a day</li>
  <li>once a week</li>
  <li>once a month</li>
  <li>before DB migration to newer version</li>
</ul>
<p>So in total you'll have at most 4 backups from different points in time
  which should protect you from various problems. These backups are stored
  by default in <code>backup</code> directory placed in the <a href="#root/_help_tAassRL4RSQL">data directory</a>.</p>
<p>This is only very basic backup solution, and you're encouraged to add
  some better backup solution - e.g. backing up the&nbsp;<a class="reference-link"
  href="#root/_help_wX4HbRucYSDD">Database</a>&nbsp;to cloud / different
  computer etc.</p>
<p>Note that&nbsp;<a class="reference-link" href="#root/_help_cbkrhQjrkKrh">Synchronization</a>&nbsp;provides
  also some backup capabilities by its nature of distributing the data to
  other computers.</p>
<h2>Restoring backup</h2>
<p>Let's assume you want to restore the weekly backup, here's how to do it:</p>
<ul>
  <li>find <a href="#root/_help_tAassRL4RSQL">data directory</a> Trilium uses
    - easy way is to open "About Trilium Notes" from "Menu" in upper left corner
    and looking at "data directory"
    <ul>
      <li>I'll refer to <code>~/trilium-data</code> as data directory from now on</li>
    </ul>
  </li>
  <li>find <code>~/trilium-data/backup/backup-weekly.db</code> - this is the&nbsp;
    <a
    class="reference-link" href="#root/_help_wX4HbRucYSDD">Database</a>&nbsp;backup</li>
  <li>at this point stop/kill Trilium</li>
  <li>delete <code>~/trilium-data/document.db</code>, <code>~/trilium-data/document.db-wal</code> and <code>~/trilium-data/document.db-shm</code> (latter
    two files are auto generated)</li>
  <li>copy and rename this <code>~/trilium-data/backup/backup-weekly.db</code> to <code>~/trilium-data/document.db</code>
  </li>
  <li>make sure that the file is writable, e.g. with <code>chmod 600 document.db</code>
  </li>
  <li>start Trilium again</li>
</ul>
<p>If you have configured sync then you need to do it across all members
  of the sync cluster, otherwise older version (restored backup) of the document
  will be detected and synced to the newer version.</p>
<h2>Disabling backup</h2>
<p>Although this is not recommended, it is possible to disable backup in <code>config.ini</code> in
  the <a href="#root/_help_tAassRL4RSQL">data directory</a>:</p><pre><code class="language-text-x-trilium-auto">[General]
... some other configs
# set to true to disable backups (e.g. because of limited space on server)
noBackup=true</code></pre>
<p>You can also review the <a href="#root/_help_Gzjqa934BdH4">configuration</a> file
  to provide all <code>config.ini</code> values as environment variables instead.</p>
<p>See <a href="https://github.com/TriliumNext/Trilium/blob/master/config-sample.ini">sample config</a>.</p>